#include "father.h"
#include "person.h"

using namespace A;

class Grandson_pub : public Son_pub {
public:
    void test(void){
        room_key = 1;
        address = 2;
    }
};

class Grandson_pri : public Son_pri {
public:
    void test(void){
//        room_key = 1;
//        address = 2;
    }
};

class Student : public Person {
private:
    int grade;
public:
    int getGrade(void) { return grade;}
    void setGrade(void) { this->grade = grade;}
    void printInfo(void) {
        cout << "class Student printInfo" << endl;
        Person::printInfo();
    }
};

void test_fun(Person &p)
{
    p.printInfo();
}

int main(int argc, char **argv) {
    Son_pub s;
    s.setMoney(10);
    cout << s.getMoney() << endl;
    s.it_skill();
    s.play_game();

//    s.room_key = 10;

    Son_pro s_pro;
    s_pro.play_game();

    Son_pri s_pri;
    s_pri.play_game();

//    s_pro.it_skill();
//    s_pri.it_skill();

    Student stu;
    stu.printInfo();

    Person per("zhangsan", 16);

    test_fun(per);
    test_fun(stu);

    return 0;
}